package com.puyuba.puyuba.view.adapter;

import android.view.View;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.puyuba.puyuba.R;
import com.puyuba.puyuba.bean.MsgListBean;
import com.puyuba.puyuba.view.activity.MsgListActivity;
import com.pyb.java.commonutil.ImageHelper;

public class MessageOneAdatper extends BaseQuickAdapter<MsgListBean.ListBean,BaseViewHolder> {

    public MessageOneAdatper(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, MsgListBean.ListBean item) {
        ImageHelper.getInstance().displayWithCircle(helper.getView(R.id.iv_msg_user),R.mipmap.icon_message);
        helper.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                MsgListActivity.startActivity(helper.itemView.getContext(),item.getId());
            }
        });

        helper.setText(R.id.tv_content,item.getTitle());
        helper.setText(R.id.tv_time,item.getTime_str());
//        helper.setText(R.id.tv_status,item.getStatus()==0 ? "「未读」" : "「已读」");
    }

    
}
